package chat01;
import java.util.Scanner;
public class Sum {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入第一个整数:");
        int firstNumber = scanner.nextInt();
        System.out.print("请输入第二个整数:");
        int secondNumber = scanner.nextInt();
        // 计算和与差
        int sum = firstNumber + secondNumber;
        int difference = firstNumber - secondNumber;
        // 输出结果
        System.out.println("它们的和是：" + sum);
        System.out.println("它们的差是：" + difference);
        // 关闭Scanner对象
        scanner.close();
    }
}

